package practice01;

import java.util.ArrayList;
import java.util.List;

public class BeSuper {

	private List<User> users;
	private List<Question> questions;
	private List<Answer> answers;
	
	public BeSuper() {
		users = new ArrayList<User>();
		questions = new ArrayList<Question>();
		answers = new ArrayList<Answer>();
	}

	public List<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	public List<Question> getQuestions() {
		return questions;
	}

	public void setQuestions(List<Question> questions) {
		this.questions = questions;
	}

	public List<Answer> getAnswers() {
		return answers;
	}

	public void setAnswers(List<Answer> answers) {
		this.answers = answers;
	}

}

class User {
	private String name;
	private int score;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}
}

class Question {
	private String id;
	private String from;
	private boolean solved;
	private String content;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getFrom() {
		return from;
	}
	public void setFrom(String from) {
		this.from = from;
	}
	public boolean isSolved() {
		return solved;
	}
	public void setSolved(boolean solved) {
		this.solved = solved;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public String toString() {
		String template = "[%s] %s. [%s] from %s";
		String solvedLabel = isSolved() ? "SOLVED" : "UNSOLVED";
		return String.format(template, solvedLabel, id, content, from);
	}
}

class Answer {
	private String id;
	private String from;
	private String content;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getFrom() {
		return from;
	}
	public void setFrom(String from) {
		this.from = from;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public String toString() {
		return id = ": [Answer: " + content + ", from " + from + "]";
	}
	
}
